package com.econ.powercloud.ems.config;

import com.econ.powercloud.ems.common.util.IdWorker;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Random;

/**
 * @Author : zjf
 * @Description :
 * @Date : 2021/12/2 9:25
 * @Modified by : zjf
 */
@Configuration
public class AuthIdWorkerConfiguration {

    @Bean("idWork")
    public IdWorker getIdWorker(){
        Random random = new Random();
        IdWorker idWorker = new IdWorker(Math.abs(random.nextLong())%10, 1L);
        return idWorker;
    }
}
